<?php

!defined('DEBUG') AND exit('Access Denied.');

$action = param(1, 'cache');

if($action == 'cache') {

	if(!admin_authority_check()) header("Location:".url('index-login'));
	if($method == 'GET') {
		include _include(ADMIN_PATH.'view/htm/other_cache.htm');
	} else {
		rmdir_recusive($conf['tmp_path'], 1);
		message(0, '清理完成');
	}

}elseif($action == 'trash'){

	if(!admin_authority_check()) header("Location:".url('index-login'));
	if($method == 'GET') {
		include _include(ADMIN_PATH.'view/htm/other_trash.htm');
	} else {
		$passcode = param('passcode');
		if(md5(md5($passcode).'ryTY45Rg')!=$conf['passcode']){
			message(-1, '安全码错误');
		}
		
		$status = param('status', 'all');
      	$type = param('type');
      	$fdate = strtotime(param('fdate'));
      	$tdate = strtotime(param('tdate'));
      	$cond = array('time'=>array('>='=>$fdate,'<='=>$tdate));
      	if($status!='all') $cond['status'] = $status;
      	$count = db_count($type, $cond);
      	db_delete($type, $cond);
      	message(1, '删除了'.$count.'条数据');
	}

}

?>

